package org.lanqiao.tjut.model;

import java.util.ArrayList;
import java.util.List;

import org.apache.commons.dbutils.handlers.BeanListHandler;
import org.lanqiao.tjut.bean.TBAdminsBean;
import org.lanqiao.tjut.db.DBFactory;

public class UserLoginModel {
public List<TBAdminsBean> getUserLoginInfo(TBAdminsBean adminsB){
	//组织数据查询操作SQL语句
	String strSql="select * from tbadmins where admins_name=? and admins_psw=?";
	//查询语句的SQL参数
	List<Object> lstParas=new ArrayList<>();
	//添加参数
	lstParas.add(adminsB.getAdmins_name());
	lstParas.add(adminsB.getAdmins_psw());
	//调用db层执行SQL语句
	List<TBAdminsBean> lstAdmins=DBFactory.getDBDriverInstance().query(strSql,
			       new BeanListHandler<>(TBAdminsBean.class),lstParas.toArray());
	//返回登陆查询结果信息集
	return lstAdmins;
}
}
